//
//  UILabel+WBLabel.m
//  WeiBoOC
//
//  Created by 韩菲菲 on 16/8/13.
//  Copyright © 2016年 韩菲菲. All rights reserved.
//

#import "UILabel+WBLabel.h"

@implementation UILabel (WBLabel)

- (instancetype)initWithFont:(CGFloat)font andTextColor:(UIColor *)color
{
    
    return [self initWithFont:font andTextColor:color andMaxWidth:0];

}


//根据最大maxwidth决定是不是换行
- (instancetype)initWithFont:(CGFloat)font andTextColor:(UIColor *)color andMaxWidth:(int)maxWidth
{
    self = [[UILabel alloc] init];
    
    self.font = [UIFont systemFontOfSize:font];
    
    self.textColor = color;
    
    if(maxWidth > 0)
    {
        self.numberOfLines = 0;
        self.preferredMaxLayoutWidth = maxWidth;
    
    }

    return self;

}


@end
